/*
 *  @author zhangqiang
 *  @data 2017/03/14
 *   办理列表
 * */

import React, { Component } from 'react';
import {Toast} from 'antd-mobile';
import {ProcessList } from '../../components/handlingProgress'
import Style from './index.scss'
import {connect} from 'react-redux';
import common from '../../utils/common'
import '../../../styles/handlingProgress.scss';
import AlipayJSOperation from '../../utils/alipayJSOperation';
import {getOrderDetails} from '../../actions/orderDetailsActions'

class HandlingProgress extends Component {
    constructor(props) {
        super(props);
        this.state = {
            list: this.props.list, //列表数据
            msg: '订单号220987676578', //最新状态
            orderInfo:{ //订单详情
                title: '林炳新个人游港澳再签注', //主标题
            }
        }
    }

    componentWillMount() {

    }

    componentDidMount() {
	    common.setViewTitle('进度详情');
	    let getData = {
		    chargeOrderId: this.props.params.chargeId,
		    orderId: this.props.params.orderId
	    }
	    this.props.dispatch(getOrderDetails(getData))
    }

    render() {
        let res = this.props.detailsData;
        return (
            <div className={Style.handlingProgress}>
	            <div style={{height: '.24rem',background: '#f2f2f2'}}></div>
                <div className={Style.info}>
                    <div className={Style.title + ' text-overflow-one'}>{res.orderTitle}</div>
                    <div className={Style.msg + ' text-overflow-one'}>{`订单号${res.orderId||''}`}</div>
                </div>
                    <div style={{height: '.24rem',background: '#f2f2f2'}}></div>
                    <div className={Style.processListBox}>
                        <ProcessList list={res.processlist}/>
                    </div>
            </div>
        );
    }
}

HandlingProgress.defaultProps = {
    detailsData:{},
    list:[{
	    handleMsg: '将来时',
	    handleDate: '2016-03-23 14：00'
    }]
}

function mapStateToProps(state) {
	return Object.assign({}, state.orderDetails);
}

export default connect(mapStateToProps)(HandlingProgress)
